package br.perfiman.faces;

import br.perfiman.model.Asset;
import br.perfiman.model.Portfolio;
import br.perfiman.service.AbstractService;
import br.perfiman.service.PortfolioService;
import br.perfiman.utils.ServiceLocator;

public class PortfolioBean extends AbstractBean<Portfolio> {

	public PortfolioBean() throws Exception {
		if(getEntity() == null){
			setEntity(new Portfolio());
			getEntity().setAsset(new Asset());
		}
		retrieveAll();
	}

	@Override
	protected AbstractService<Portfolio> getService() throws Exception {
		if(service == null){
			service = (PortfolioService) ServiceLocator.getInstance().get("PortfolioServiceBean/remote");
		}
		return service;
	}

	@Override
	public String remove() throws Exception {
		//can't add/remove portfolio manually
		return null;
	}

	@Override
	public String save() throws Exception {
		//can't add/remove portfolio manually
		return null;
	}
}
